// Xampler, a MIDI-driven sampler
// Copyright (C) 2006 Nick Thomas
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
// 02110-1301 USA.

#ifndef XAMPLER_SYNTH_MESSAGE_HPP
#define XAMPLER_SYNTH_MESSAGE_HPP

// Defines a message type and a global message queue for allowing the
// synthesis thread to send its status to the UI thread.

#include "MessageBuffer.hpp"

namespace xampler
{
    enum SynthMessageType
    {
        SYNTH_MSG_SAMPLE_ON,
        SYNTH_MSG_SAMPLE_OFF
    };

    struct SynthMessageSampleOnOff
    {
        SynthMessageType type;
        int instrument;
        int sample;
    };

    union SynthMessage
    {
        SynthMessageType type;
        SynthMessageSampleOnOff sample_on;
        SynthMessageSampleOnOff sample_off;
    };

    const int SYNTH_MESSAGE_BUFFER_SIZE = 128;
    extern MessageBuffer<SynthMessage> *g_synth_message_buffer;
}

#endif
